package cn.myschool.test.day2;

import cn.myschool.dao.ExamDao;
import cn.myschool.entity.ExamResult;
import cn.myschool.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @author oldliu
 * @since 1.0
 */
public class SearchResult {
    public static void main(String[] args) {
        //写法麻烦
        SqlSession session = MybatisUtil.get();
        ExamDao mapper = session.getMapper(ExamDao.class);
        //StudentDao studentDao=session.getMapper(StudentDao.class);

        List<ExamResult> all = mapper.findALL();
        for(ExamResult r:all){
            //Student student = studentDao.get(r.getStid());
            System.out.println("成绩："+r+"属于学生："+r.getStu());
        }
        MybatisUtil.close(session);
    }
}
